'use strict';
exports.main = async (event, context) => {
    //event为客户端上传的参数
    console.log('event : ', event)

    let {
        id
    } = event;

    // 数据库请求
    let arrs = [{
            id: "1001",
            title: "测试",
        },
        {
            id: "1002",
            title: "测试2",
        }
    ]

    let good = {};

    arrs.forEach(item => {
        if (item.id === id) {
            good = item
        }
    })

    //返回数据给客户端
    return good;
};